﻿//this file used to achieve the logic of the game

//create the gameScene
function createGameScene(gridRows, gridCols, mines)
{
    var component=Qt.createComponent("sweepMine.qml");
    if (component.status===Component.Ready){
        var gameScene=component.createObject(null,{"gridRows":gridRows,"gridCols":gridCols,"mines":mines});
        if (gameScene===null){
            console.log("create object failed");
        }
        else{
            console.log("create object successful!");
            stackView.push(gameScene);
        }
    }
    else{
        console.log(component.errorString());
    }
}
